<template>
        <van-tabbar v-model="active" route>
            <van-tabbar-item v-for="item in tabbarItemRoutes" :key="item.path" :to="item.path"
                :icon="item.meta?.icon">{{ item.meta?.title }}
            </van-tabbar-item>
        </van-tabbar>
</template>

<script>
import routes from '@/router/routes'
export default {
    name:"",
    data() {
        return {
            active:0
        }
    },
    computed: {
        tabbarItemRoutes() {
            return routes.filter(route => route.meta?.inMenu)
        }
    }
    
}
</script>

<style lang="less" scoped>

</style>




<!-- <script setup lang="ts">
// import { computed, ref } from 'vue'
// import routes from '../../router/routes'
// import useCartStore from '../../store/cart';

// tabbar 中激活项的索引
// const active = ref(0)
// 计算在 tabbar-item 中显示渲染的路由信息
// const tabbarItemRoutes = computed(() => routes.filter(route => route.meta?.inMenu))

// ?. 这是可选链运算符，在对象属性调用时，可不必显式验证是否存在
// ?? 空值合并运算符   const result = exp1 ?? exp2   当 exp1 为 null 或 undefined 时，返回 exp2，否则返回 exp1

// const store = useCartStore()
// 购物车商品数量
</script>

<style scoped>

</style> --> -->
